package bdcin.servlet.actions.tese;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bdcin.classesbasicas.Area;
import bdcin.classesbasicas.Docente;
import bdcin.excecoes.BuscarException;
import bdcin.fachada.BDCInFactory;
import bdcin.fachada.IBDCIn;
import bdcin.servlet.actions.Action;

public class CarregarDadosTese extends Action {

	@Override
	public void executar(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		IBDCIn facade = BDCInFactory.getFacade();
		List<Area> areas=null;
		List<Docente> docentes=null;
		try {
			areas = facade.listarAreas();
			docentes = facade.buscarDocentePorNome("");
		} catch (BuscarException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}


		request.setAttribute("areas", areas);
		request.setAttribute("docentes", docentes);

		request.getRequestDispatcher("/tese/cadastrarTese.jsp").forward(request, response);



	}

}
